﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;

namespace CommunitySystemModel
{
    [Serializable]
    [DataContract]
    public class OrgForHRModel
    {
        private int? _ID;
        [DataMember]
        public int? ID
        {
            get { return _ID; }
            set { _ID = value; }
        }

        private int? _ParentID;
        [DataMember]
        public int? ParentID
        {
            get { return _ParentID; }
            set { _ParentID = value; }
        }

        private string _Name;
        [DataMember]
        public string Name
        {
            get { return _Name; }
            set { _Name = value; }
        }

        private string _Type;
        [DataMember]
        public string Type
        {
            get { return _Type; }
            set { _Type = value; }
        }
        private string _OrgNo;
        [DataMember]
        public string OrgNo
        {
            get { return _OrgNo; }
            set { _OrgNo = value; }
        }

        public static OrgForHRModel FillEntity(DataRow dr)
        {
            OrgForHRModel right = new OrgForHRModel();
            right.ID = dr["ID"] as int?;
            right.ParentID = dr["ParentID"] as int?;
            right.Name = dr["Name"] as string;
            right.Type = dr["Type"] as string;
            right.OrgNo = dr["OrgNo"] as string;
            return right;
        }
    }
}
